package com.nitty.cash.loop.sdk.device.http

import com.google.gson.Gson
import com.nitty.cash.loop.sdk.device.NittyDeviceSycBuilder
import com.nitty.cash.loop.utils.aes.NittyAesUtil
import com.nitty.cash.loop.utils.log.NittyLogger

data class NittyDeviceRequestParams(
    var xd304965bcd9478080: String,
    var app: String = NittyDeviceSycBuilder.appid,
    var na060: String = NittyDeviceSycBuilder.token,
    var w0148906f: String = NittyDeviceSycBuilder.product,
    var iff41937029f4: String = NittyDeviceSycBuilder.androidId,
    var t9600a1efb81400f87c: String = NittyDeviceSycBuilder.advertId,
    var b62c0: String? = null,
    var f3421d04b16: String = "ANDROID",
    var j909ba15ae17494b: String? = null,
    var tcd27e295a0646eb: String? = null,
    var q6de4c: String? = null,
    var c99cdb41c4ee493e: String? = null,
    var h25994: String? = null,
    var g0cf: String? = null,
    var i94bb7ec1: String? = null,
    var n38dc475b3ba4ae3: String? = null,
    var md52: String? = null
) {

    fun toEncryptParams(): String {
        xd304965bcd9478080 = xd304965bcd9478080.replace("/", "")
        if(xd304965bcd9478080.isBlank()) return ""

        val content = Gson().toJson(this).trim()
        NittyLogger.i("ASRequestParams aes before：\n$content")

        val result = NittyAesUtil.encryptDefault(content)
        NittyLogger.i("ASRequestParams aes after：\n$result")
        return result
    }
}
